package sms03.sms;

import java.time.LocalDate;

public class MiddleStudent extends Student implements EveningStudy {
    /*历史成绩*/
    private Integer historyScore;
    /*物理成绩*/
    private Integer physicsScore;

    public MiddleStudent(Integer studentId, String name,Integer chineseScore, Integer mathScore, LocalDate enrollmentDates, String email, Integer historyScore, Integer physicsScore) {
        super(studentId, name, chineseScore, mathScore, enrollmentDates, email);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudent(Integer studentId, String name, Integer chineseScore,Integer mathScore, Integer historyScore, Integer physicsScore) {
        super(studentId, name, chineseScore, mathScore);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudent(Integer studentId, String name, Integer chineseScore, Integer mathScore, LocalDate enrollmentDates, Integer historyScore, Integer physicsScore) {
        super(studentId, name, chineseScore, mathScore, enrollmentDates);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public Integer getHistoryScore() {
        return historyScore;
    }

    public void setHistoryScore(Integer historyScore) {
        this.historyScore = historyScore;
    }

    public Integer getPhysicsScore() {
        return physicsScore;
    }

    public void setPhysicsScore(Integer physicsScore) {
        this.physicsScore = physicsScore;
    }

    /*重写晚自习方法*/
    @Override
    public void eveningStudy() {
        System.out.println("中学生" + getName() + "正在上晚自习");
    }
    /*中学生总成绩*/
    @Override
    public Integer getTotalScore() {
        return super.getTotalScore() + historyScore + physicsScore;
    }

    /*显示学生信息*/
    @Override
    public String toString() {
        return getStudentId() + " " + getName() + " " + getChineseScore() + " "
                + getMathScore() + " " + getHistoryScore() + " " + getPhysicsScore() + " "
                +" "+getEmail()+" "+ getEnrollmentDates() + " " + getTotalScore();
    }
}
